//
//  YSTopicItemCell.m
//  Yueshi
//
//  Created by yueshi－mac1 on 15/12/8.
//  Copyright © 2015年 悦食中国. All rights reserved.
//

#import "YSTopicItemCell.h"

@implementation YSTopicItemCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"YSTopicItemCell";
    YSTopicItemCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[YSTopicItemCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        YSTopicItemView *itemView = [[YSTopicItemView alloc] init];
        self.itemView = itemView;
        [self addSubview:itemView];
    }
    return  self;
}

- (void)setItemFrame:(YSTopicItemFrame *)itemFrame{
    _itemFrame = itemFrame;
    _itemView.itemFrame = itemFrame;
}

- (void)setIndexPath:(NSIndexPath *)indexPath{
    _itemView.indexPath = indexPath;
}

@end
